package com.itheima.nosql.action;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import redis.clients.jedis.JedisCluster;

@RestController
@RequestMapping("/api/redis")
@Api(tags = {"redis"})
public class RedisController {
    private  final static Logger log = LoggerFactory.getLogger(RedisController.class);
    @Autowired
    JedisCluster cluster;



    @GetMapping("/cluserSet/{key}/{value}")
    @ApiOperation(value = "集群分片赋值")
    public Object cluserSet(@PathVariable String key,@PathVariable String value){
        cluster.set(key,value);
        return cluster.get(key);
    }


}
